package cn.duli.xianer.service.impl;


import cn.duli.xianer.dao.OrderRefundMapper;
import cn.duli.xianer.pojo.OrderRefund;
import cn.duli.xianer.service.OrderRefundService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class OrderRefundServiceImpl implements OrderRefundService {

    @Resource
    private OrderRefundMapper orderRefundMapper;

    @Override
    public int save(OrderRefund orderRefund) {
        orderRefundMapper.save(orderRefund);
        return orderRefund.getOrId();
    }

    @Override
    public OrderRefund findById(Integer orId) {
        return orderRefundMapper.findById(orId);
    }

    @Override
    public OrderRefund findByOrderId(Integer oId) {
        return orderRefundMapper.findByOrderId(oId);
    }

    @Override
    public boolean updateRefundStatus(Integer orStatus, Integer orId) {
        int temp = orderRefundMapper.updateRefundStatus(orStatus, orId);
        if (temp!=0) {
            return true;
        }
        return false;
    }

}
